Skip to content

Conversation

sandhose
Copy link
Member

The intent is to simplify the setup process by only requiring a shared secret between the HS and MAS, instead of having to provision a static client for the HS.

@sandhose sandhose requested a review from reivilibre July 22, 2025 09:20
@sandhose sandhose added A-Homeserver-Integration Integration with the homeserver T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks. labels Jul 22, 2025
Copy link

cloudflare-workers-and-pages bot commented Jul 22, 2025

Deploying matrix-authentication-service-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 85be5e1
Status: ✅  Deploy successful!
Preview URL: https://1a1e2c61.matrix-authentication-service-docs.pages.dev
Branch Preview URL: https://quenting-introspection-with.matrix-authentication-service-docs.pages.dev

View logs

@sandhose sandhose force-pushed the quenting/introspection-with-shared-token branch from e603fd7 to 74bd3fe Compare July 22, 2025 09:28
Copy link
Contributor

@reivilibre reivilibre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fair enough

// Basic and Bearer at the same time, so we need to parse them manually
let authorization = if let Some(header) = req.headers().get(http::header::AUTHORIZATION) {
let bytes = header.as_bytes();
if bytes.len() >= 6 && bytes[..6].eq_ignore_ascii_case(b"Basic ") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if bytes.len() >= 6 && bytes[..6].eq_ignore_ascii_case(b"Basic ") {
if bytes.starts_with(b"Basic ") {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to make a case-insensitive comparison, hence the eq_ignore_ascii_case

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah derp, fine :)

decoded.username().to_owned(),
decoded.password().to_owned(),
))
} else if bytes.len() >= 7 && bytes[..7].eq_ignore_ascii_case(b"Bearer ") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
} else if bytes.len() >= 7 && bytes[..7].eq_ignore_ascii_case(b"Bearer ") {
} else if bytes.starts_with(b"Bearer ") {

Co-authored-by: reivilibre <[email protected]>
@sandhose sandhose enabled auto-merge July 22, 2025 11:24
@sandhose sandhose merged commit 0629915 into main Jul 22, 2025
20 checks passed
@sandhose sandhose deleted the quenting/introspection-with-shared-token branch July 22, 2025 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Homeserver-Integration Integration with the homeserver T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants